<!DOCTYPE HTML>
<html style="width:100%;height:100%">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>main</title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/font-awesome.css" />
</head>

<body>
    <header id="head" ; class="aui-bar aui-bar-nav" style="background-color:rgb(249,249,251);position:fixed; z-index:2">
        <img src="./image/321jiedui.png" alt="321照片">
    </header>


</body>
<script type="text/javascript" src="./script/api.js"></script>
<script src="./script/commonUtil.js"></script>
<script type="text/javascript">
    var deviceH;
    var deviceW;
     //首页，我的活动，添加活动，结对学生，个人中心
     var pagenames = ["Broadcast", "Activities", "addmovement", "Pairstudents", "mine"];
    var pageConfig = [{
            name: "Broadcast",
            url: "html/Broadcast.html"
        },
        {
            name: "Activities",
            url: "html/Activities.html"
        }, {
            name: "addmovement",
            url: "html/addmovement.html"
        }, {
            name: "Pairstudents",
            url: "html/Pairstudents.html"
        }, {
            name: "mine",
            url: "html/mine.html"
        },
    ]
    apiready = function () {
        var head = $api.byId('head');
        var offset = $api.offset(head);
        var h = offset.h;
        deviceH = api.winHeight;
        deviceW = api.winWidth;
        $c.openFrame(pageConfig[0].name, pageConfig[0].url, h, 50, pageCommonOther);
        NVTabBar = api.require('NVTabBar');
        NVTabBar.open(configJson, function (ret, err) {
            if (ret.eventType == "click") {
                var index = ret.index;
                switch (index) {
                    case 0:
                        $c.openFrame(pageConfig[0].name, pageConfig[0].url, h, 50, pageCommonOther);
                        NVTabBar.bringToFront();
                        break;
                    case 1:
                        $c.openFrame(pageConfig[1].name, pageConfig[1].url, h, 50, pageCommonOther);
                        NVTabBar.bringToFront();
                        break;
                    case 2:
                        $c.openWin(pageConfig[2].name, pageConfig[2].url);
                        NVTabBar.bringToFront();
                        break;
                    case 3:
                        $c.openFrame(pageConfig[3].name, pageConfig[3].url, h, 50, pageCommonOther);
                        NVTabBar.bringToFront();
                        break;
                    case 4:
                        $c.openFrame(pageConfig[4].name, pageConfig[4].url, h, 50, pageCommonOther);
                        NVTabBar.bringToFront();
                        break;
                    default:
                        break;
                }
            }
        });
        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            api.closeWidget();
        });
    };
   
    pageCommonOther = {
        bgColor: 'rgba(0,0,0,0)',
        bounces: false,
        vScrollBarEnabled: false,
        hScrollBarEnabled: false
    }
    var configJson = {
        styles: {
            h: 57,
            dividingLine: {
                width: 0.5,
                color: '#c5c5c5'
            },
            badge: {
                bgColor: '#000',
                numColor: '#fff',
                size: 9.0,
                centerX: 40,
                centerY: 6
            }
        },
        items: [{
            w: deviceW / 5.0,
            bg: {
                marginB: 0,
                image: '#fff'
            },
            iconRect: {
                w: 25.0,
                h: 25.0,
            },
            icon: {
                normal: 'widget://icon/house1.png',
                highlight: 'widget://icon/house.png',
                selected: 'widget://icon/house.png'
            },
            title: {
                text: '首页',
                size: 12.0,
                normal: '#8E8E8E',
                selected: '#eb4f38',
                marginB: 6.0
            }
        }, {
            w: deviceW / 5.0,
            bg: {
                marginB: 0,
                image: '#fff'
            },
            iconRect: {
                w: 25.0,
                h: 25.0,
            },
            icon: {
                normal: 'widget://icon/compass.png',
                highlight: 'widget://icon/compass2.png',
                selected: 'widget://icon/compass2.png'
            },
            title: {
                text: '活动',
                size: 12.0,
                normal: '#8E8E8E',
                selected: '#eb4f38',
                marginB: 6.0
            }
        }, {
            w: deviceW / 5.0,
            bg: {
                marginB: 10,
                image: 'rgba(0,0,0,0)' //中间背景图
            },
            iconRect: {
                w: 60,
                h: 60,
            },
            icon: {
                normal: 'widget://icon/add.png',
                highlight: 'widget://icon/add.png',
                selected: 'widget://icon/add.png'
            },
            title: {
                text: '',
                size: 12.0,
                normal: '#8E8E8E',
                selected: '#eb4f38',
                marginB: 0
            }
        }, {
            w: deviceW / 5.0,
            bg: {
                marginB: 0,
                image: '#fff'
            },
            iconRect: {
                w: 25.0,
                h: 25.0,
            },
            icon: {
                normal: 'widget://icon/friend.png',
                highlight: 'widget://icon/friend1.png',
                selected: 'widget://icon/friend1.png'
            },
            title: {
                text: '结对',
                size: 12.0,
                normal: '#8E8E8E',
                selected: '#eb4f38',
                marginB: 6.0
            }
        }, {
            w: deviceW / 5.0,
            bg: {
                marginB: 0,
                image: '#fff',
            },
            iconRect: {
                w: 25.0,
                h: 25.0,
            },
            icon: {
                normal: 'widget://icon/person.png',
                highlight: 'widget://icon/person1.png',
                selected: 'widget://icon/person1.png'
            },
            title: {
                text: '我的',
                size: 12.0,
                normal: '#8E8E8E',
                selected: '#eb4f38',
                marginB: 6.0
            }
        }],
        selectedIndex: 0
    }

    function SetIndex() {
        NVTabBar.bringToFront();
    }
</script>

</html>